AGT-02: Add tool registry, policy evaluator, and inbox triage template#502
AGT-02: Add tool registry, policy evaluator, and inbox triage template#502Chris0Jeky merged 5 commits intomainfrom
Conversation
…kTool, ITaskdeckToolRegistry interfaces, and PolicyDecision value object Part of #337 (AGT-02). These domain primitives define the tool abstraction, scope/risk classification, and policy decision contract that the Application layer policy evaluator and tool registry build on.
Implements the Application layer for AGT-02 (#337): - IAgentPolicyEvaluator interface for tool-use policy checks - TaskdeckToolRegistry: in-memory, thread-safe tool registry - AgentPolicyEvaluator: allowlist enforcement, risk-level review gating, auto-apply OFF by default for all risk levels - TaskdeckToolDefinition: concrete ITaskdeckTool record - InboxTriageAssistant: bounded template that creates proposals from pending inbox items, never directly mutating board state
…tant 42 tests covering: - ToolRegistryTests: registration, duplicate rejection, lookup, case-insensitive keys, scope filtering - AgentPolicyEvaluatorTests: allowlist enforcement, risk-level review gating (high/medium always review, low review by default), auto-apply opt-in, disabled profile denial, policy JSON parsing - InboxTriageAssistantTests: proposal creation, no direct board mutation, policy routing, validation, edge cases
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Add missing `using` on JsonDocument.Parse to prevent resource leak. Found during adversarial self-review.
Adversarial Self-ReviewReviewed the full diff critically. Findings: Fixed
Noted (acceptable)
No issues found in
|
Adversarial Code Review — PR #502 (AGT-02)I read every line of the diff across all 10 new files. Here are my findings, ordered by severity. BUG: Missing DI Registration
Without these registrations, nothing in this PR can be resolved at runtime. Any controller or service depending on these will fail with a BUG: No Tool Registration at Startup
registry.RegisterTool(InboxTriageAssistant.GetToolDefinition());Without this, Both this and the DI registration above need startup wiring — likely in DESIGN: PolicyDecision Equality Semantics
This means
Recommendation: make it DESIGN: ITaskdeckToolRegistry in Domain Layer
Consider: Keep This doesn't fail architecture tests today because the Domain files don't import forbidden namespaces, but it loosens the Domain purity principle. MINOR: AgentPolicyConfig Mutability
Since this is MINOR: No Test for TruncateTitle Edge Cases
These are covered indirectly through integration tests but the method deserves its own unit test (it's MINOR: Deny Decision Semantics
What Looks Good
VerdictThe two DI/startup registration issues are blocking — without them, the entire feature is dead code that will fail at runtime. The PolicyDecision equality issue is a significant design concern that should be addressed before or shortly after merge to avoid future bugs when someone inevitably writes The remaining items are minor and can be addressed in follow-up. |
The tool registry, policy evaluator, and inbox triage assistant were missing DI registrations, making the entire feature unresolvable at runtime. Also registers the inbox.triage tool definition at startup so the policy evaluator can find it.
Summary
Implements #337 — the second agent infrastructure slice, building on AGT-01's agent profile/run/event foundation.
ToolScopeandToolRiskLevelenums,ITaskdeckToolinterface,ITaskdeckToolRegistryinterface,PolicyDecisionvalue object with factory methods (AllowWithReview, Deny, AllowDirect)IAgentPolicyEvaluatorinterface,AgentPolicyEvaluatorservice (allowlist enforcement, risk-level review gating, auto-apply OFF by default),TaskdeckToolRegistry(in-memory, thread-safe, case-insensitive),InboxTriageAssistantbounded template (gathers inbox items, creates proposals, never directly mutates board state)Key design decisions:
autoApplyLowRisk: truein profile policy JSONTest plan
dotnet build backend/Taskdeck.sln -c Releasepassesdotnet test backend/Taskdeck.sln -c Release -m:1passes (all existing + 42 new tests)